/* 重写一个新的样式吧 20250601 */


.main-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: 0 0 15px rgba(0,0,0,0.05); 
    border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6;
    padding: 10px 0;
    font-size: 16px;
}

/* 标题 */
h1, h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 300;
}

h1 {
    font-size: 2.2em;
    margin-top: 0;
}

h3 {
    font-size: 1.6em;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 8px;
}

/* 超链接 */
a {
    display: inline-block; /* 为了让margin-top和bottom生效 */
    color: #3498db;
    text-decoration: none;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: 5px;
    margin-right: 5px;
    transition: color 0.2s ease-in-out;
}

a:hover, a:focus {
    color: #2980b9;
    text-decoration: underline;
}

/* 表单 box */
form, .box {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

/* 兼容上古浏览器的表单调用api */
.linemode .linemode form {
    padding: 0;
    border-radius: unset;
    box-shadow: unset;
    background-color: unset;
    border:0;
}

/* 居中 */
.main-container > form {
    margin-left: auto;
    margin-right: auto;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 500;
}

/* 输入框 */
input[type="text"],
input[type="file"],
select,
textarea {
    /* width: 100%; */
    padding: 12px 15px;
    border: 1px solid #dce4ec;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.5;
    color: #2c3e50;
    background-color: #fdfdfe;
    margin-bottom: 15px;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

input::placeholder, textarea::placeholder {
    color: #95a5a6;
    opacity: 1;
}

/* 按钮 */
button {
    min-height: 2.5em;
    min-width: 5em;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
    margin: 0.5em;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0px);
}

.red {
    background-color: #e74c3c;
}
.red:hover {
    background-color: #c0392b;
}

/* 横向布局 */
.linemode {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    /* margin: 1.5em 0; */
    padding: 15px;
    /* background-color: #ecf0f1; */
    border-radius: 8px;
}

/* 嵌套去除多余大小 */
.linemode .linemode {
    padding: 0;
    border: 0;
    margin: 0;
}

/* 直接子元素 */
.linemode > * {
    margin: 0.5em;
}

.linemode h1 {
    margin: 0.5em;
    width: 100%;
    text-align: center;
}

.me-title {
    width: auto !important;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
    color: #34495e;
}

/* 勾选框 */
input[type="checkbox"] {
    width: auto;
    margin-left: 8px;
    margin-right: 8px;
    margin-bottom: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 1.5em;
    height: 1.5em;
    border: 1px solid #bdc3c7;
    border-radius: 3px;
    vertical-align: middle;
    cursor: pointer;
    position: relative;
    top: -1px;
}

input[type="checkbox"]:checked {
    background-color: #3498db;
    border-color: #3498db;
}

input[type="checkbox"]:checked::before {
    content: '\2714'; /* 对勾符号 */
    display: block;
    text-align: center;
    color: white;
    font-size: 1.5em;
    line-height: 1em;
}

/* 表格 */
table#alarms {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden; /* 为了让border-radius 裁剪th/td */
}

table#alarms th,
table#alarms td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

table#alarms th {
    background-color: #f2f5f7;
    color: #34495e;
    font-weight: 500;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 斑马条纹行 */
table#alarms tr:nth-child(even) td { 
    background-color: #fbfcfc;
}

table#alarms tr:hover td {
    background-color: #e9f5fd;
}

/* 重置表格单元格内的表单样式 */
table#alarms form { 
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

/* 确保表格内的输入框不受常规表单输入框最大宽度的影响 */
table#alarms form input[type="text"] { 
    max-width: none;
}


/* Logo */
img[src="/favicon.ico"] {
    margin-bottom: 10px;
    display: block;
}

/* 提示信息框 */
#info, #weatherMsg, #statusMsg {
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.7;
    color: #495057;
}

/* 为了在不支持css的设正常显示 */
#info br {
    display: none;
}

#info a {
    display: block;
    margin-bottom: 5px;
}

.ctrlbox {
    background-color: #ffffff !important;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.ctrlbox .linemode {
    background-color: #ffffff !important;
}

/* 调整宽度优化各种屏幕分辨率下的显示 */
#playUrl {
    width: 25em;
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }

    form {
        padding: 10px;
    }

    button {
        padding: 5px 10px;
    }

    .linemode {
        padding: 0;
    }

    input[type="text"], input[type="file"] {
        width: 12em;
    }
}

@media (max-width: 500px) {
    .linemode .linemode form {
        margin: 0;
    }

    .main-container {
        padding: 10px;
    }

    input[type="text"], input[type="file"] {
        width: 9em;
    }

    #playlistId {
        width: 7em;
    }

    #playUrl {
        width: 16em;
    }
}


@media (prefers-color-scheme: dark) {
    body {
        color: #e0e0e0;
        background-color: #121212;
    }

    .main-container {
        background-color: #1e1e1e;
    }

    h1, h3 {
        color: #f0f0f0;
        border-bottom-color: #444;
    }

    a {
        color: #5dade2;
    }

    a:hover, a:focus {
        color: #85c1e9;
    }

    form, .box {
        background-color: #2c2c2c;
    }

    label {
        color: #d0d0d0;
    }

    input[type="text"],
    input[type="file"],
    select,
    textarea {
        color: #e0e0e0;
        background-color: #333333;
        border-color: #555555;
    }

    input[type="text"]:focus,
    input[type="file"]:focus,
    select:focus,
    textarea:focus {
        border-color: #5dade2;
        box-shadow: 0 0 0 2px rgba(93, 173, 226, 0.25);
        background-color: #3a3a3a;
    }

    input::placeholder, textarea::placeholder {
        color: #888888;
    }

    button {
        background-color: #4a90e2;
        color: #ffffff;
    }

    button:hover {
        background-color: #3c7ac0;
    }

    .red {
        background-color: #e74c3c;
        color: white;
    }
    .red:hover {
        background-color: #c0392b;
    }

    .linemode {
        /* background-color: #282828; */
        border: none;
    }

    .checkbox-group label {
        color: #d0d0d0;
    }

    input[type="checkbox"] {
        border: 1px solid #777777;
        background-color: #333333;
    }

    input[type="checkbox"]:checked {
        background-color: #4a90e2;
        border-color: #4a90e2;
    }

    input[type="checkbox"]:checked::before {
        color: #ffffff;
    }

    table#alarms {
        border: 1px solid #383838;
    }

    table#alarms th,
    table#alarms td {
        border: 1px solid #444444;
    }

    table#alarms th {
        background-color: #3a3a3a;
        color: #d0d0d0;
    }

    table#alarms tr:nth-child(even) td {
        background-color: #2f2f2f;
    }

    table#alarms tr:hover td {
        background-color: #3c3c3c;
    }

    #info, #weatherMsg, #statusMsg {
        background-color: #222222;
        border: none;
        color: #c0c0c0;
    }

    #info a {
        color: #5dade2;
    }
    #info a:hover {
        color: #85c1e9;
    }

    .ctrlbox {
        background-color: #2c2c2c !important;
        border: none;
    }

    .ctrlbox .linemode {
        background-color: #2c2c2c !important;
        border: none;
    }

}